package GUI;


import java.util.ArrayList;

import javax.swing.JPanel;
import javax.swing.JLabel;

import java.awt.Font;

import javax.swing.JTextField;
import javax.swing.ImageIcon;
import javax.swing.JButton;

import Client.HTSMain;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class AddUser extends  Menu {
	private JTextField FirstNametextField;
	private JTextField LastNametextField;
	private JTextField PasswordtextField;
	private JTextField EMailtextField;
	public AddUser() {
	
		
		initComponents();
		
	}
	
	public void initComponents(){
	setLayout(null);
		
		JLabel lblUsername = new JLabel("First Name:");
		lblUsername.setFont(new Font("Tahoma", Font.PLAIN, 17));
		lblUsername.setBounds(67, 129, 93, 38);
		add(lblUsername);
		
		JLabel lblPassword = new JLabel("Password:");
		lblPassword.setFont(new Font("Tahoma", Font.PLAIN, 17));
		lblPassword.setBounds(67, 245, 113, 21);
		add(lblPassword);
		
		JLabel lblLastName = new JLabel("Last Name:");
		lblLastName.setFont(new Font("Tahoma", Font.PLAIN, 17));
		lblLastName.setBounds(67, 188, 113, 26);
		add(lblLastName);
		
		JLabel lblEmail = new JLabel("E-Mail:");
		lblEmail.setFont(new Font("Tahoma", Font.PLAIN, 17));
		lblEmail.setBounds(67, 298, 93, 21);
		add(lblEmail);
		
		FirstNametextField = new JTextField();
		FirstNametextField.setFont(new Font("Tahoma", Font.PLAIN, 17));
		FirstNametextField.setBounds(161, 133, 166, 32);
		add(FirstNametextField);
		FirstNametextField.setColumns(10);
		
		LastNametextField = new JTextField();
		LastNametextField.setFont(new Font("Tahoma", Font.PLAIN, 17));
		LastNametextField.setBounds(161, 188, 166, 32);
		add(LastNametextField);
		LastNametextField.setColumns(10);
		
		PasswordtextField = new JTextField();
		PasswordtextField.setFont(new Font("Tahoma", Font.PLAIN, 17));
		PasswordtextField.setBounds(161, 242, 166, 32);
		add(PasswordtextField);
		PasswordtextField.setColumns(10);
		
		EMailtextField = new JTextField();
		EMailtextField.setFont(new Font("Tahoma", Font.PLAIN, 17));
		EMailtextField.setBounds(161, 295, 166, 32);
		add(EMailtextField);
		EMailtextField.setColumns(10);
		
		JLabel lblNewLabel = new JLabel("");
		lblNewLabel.setIcon(new ImageIcon(AddUser.class.getResource("/Images/user-library.png")));
		lblNewLabel.setBounds(316, 108, 634, 720);
		add(lblNewLabel);
		
		JButton btnNewButton = new JButton("Confirm");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				ArrayList AddArray=new ArrayList();
	 			AddArray.add("AddUser");
	 			AddArray.add(FirstNametextField.getText());	
	 			AddArray.add(LastNametextField.getText());
	 			AddArray.add(PasswordtextField.getText());
	 			AddArray.add(EMailtextField.getText());
	 			HTSMain.chat.handleMessageFromGui(AddArray);
				
				
				
			}
		});
		btnNewButton.setFont(new Font("Tahoma", Font.BOLD, 17));
		btnNewButton.setBounds(161, 370, 166, 32);
		add(btnNewButton);
		
	}
}
